cd C:\Users\johannes.boehm\Dropbox\cenf\data\construction\cap_intensity

use concordance_klems_myagg.dta, clear

reshape long ind_klems, i(myagg) j(index)
drop if ind_klems==.
rename ind_klems rowsect

merge m:1 rowsect using bysector-us-2000.dta
drop if _merge==2 // these are not really useful... "other services"
drop _merge

rename rowsect ind_klems

bysort myagg: egen cap_myagg = mean(capshare)
duplicates drop myagg, force
drop capshare
drop index ind_klems

sort myagg
rename cap_myagg cap_intensity

save cap_myagg.dta, replace
